#{set title:'Extranet' /} 
#{extends 'main.html' /}

<!-- barra superior. codigo para mostrar o nome do usuario logado -->
<div class="navbar navbar-fixed-top">
	<div class="navbar-inner">
		<div class="container">
			<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span
				class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>
			</a> <a class="brand" align="center"> &nbsp; EXTRANET - Sistema de Controle de Tarefas</a>
			<div>
				<ul class="nav pull-right">

					<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"> Ola,
							<b>${user}</b> <b class="caret"></b>
					</a>
						<ul class="dropdown-menu">
							<li><a href="@{Application.logout()}"> <i class="icon-off"></i> Sair</a></li>
						</ul></li>
				</ul>
			</div>
		</div>
	</div>
</div>

<br><br><br>
<!-- Tabela das tarefas -->
<label align=center style="width:80%"> <h3> Quadro de Tarefas </h3> </label>
<br>
<div align="left">
		#{form @Administracao.filtrarTarefas()}
		Funcion&aacute;rio: 
			<select size="1" name="func">
					<option value = 0>-- Todos --</option>
				#{list items:funcionario, as:'f'}
				 	<option value="${f.id}">${f.nome}</option>
				#{/list}
			</select>
		Projeto:
		<select size="1" name="proj">
					<option value = 0>-- Todos --</option>
				#{list items:projeto, as:'p'}
				 	<option value="${p.id}">${p.nomeProjeto}</option>
				#{/list}
			</select>
			<br />
			<button class="btn btn-success" type="submit" id="btnPausar">
				Filtrar
			</button>
			#{/form}
</div>

<br /><br />
	<table class="table table-striped table-bordered table-condensed" style="width:80%">
		<tr>
			<!-- <th>ID</th> -->
			<th>!</th>
			<th>Prioridade</th>
			<th>ID</th>
			<th>Titulo da Tarefa</th>
			<th>Respons&aacute;vel</th>
			<th>Tempo Estimado</th>
			<th>Tempo Gasto</th>
			<th>Porcentagem conclu&iacute;da</th>
			<th>Status</th>
		</tr>
	#{list tarefas, as:'t'}
	#{if t.status == models.StatusTarefaEnum.Pausado ||  t.status == models.StatusTarefaEnum.Iniciado }
		 <tr>
			 <!-- <td>${t.id}</td> -->
			 <td> 
			 	<image class="imagem1" src="/public/images/${t.grauTarefa}.jpg" />
			 </td>
			 <td width="10px">${t.prioridade}</td>
			 <td>${t.id}</td>
			 <td>
			 	#{if t.novaTarefa}
			 		<b><a href="@{Tarefas.detalhesTarefa(t.id)}">${t.tituloTarefa}</a></b>
			 		 <sup style="color: black"><b>Nova</b></sup>
			 	#{/if}
			 	#{if !t.novaTarefa}
			 		<a href="@{Tarefas.detalhesTarefa(t.id)}">${t.tituloTarefa}</a>
			 	#{/if}
			 </td>
			 <td>${t.usuario.nome}</td>
			 <td>${t.tempoEstimado.format('0')} hs </td>
			 <td>${t.hora}:${t.minuto} hs</td>
			 <td><div class="progress progress-striped active">
					<div class="bar" 
					style="width:${t.porcentagem}%;">${t.porcentagem.format('00.0')}%</div>
					</div>
			 </td>
			<td>
			#{if t.status == models.StatusTarefaEnum.Pausado}
				<span class="label label-info">Pausado</span>
			#{/if}
			#{if t.status == models.StatusTarefaEnum.Iniciado}
				<span class="label label-info2">Iniciado</span>
			#{/if}
			
			</td>
		 </tr>
		 #{/if}
	 #{/list}
	</table>
</div>
